package com.aaa.sbm.controller;

import com.aaa.sbm.entity.StockOutApproval;
import com.aaa.sbm.service.StockOutApprovalService;
import com.aaa.sbm.util.Page;
import com.aaa.sbm.util.Result;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("stockOutApproval")
public class StockOutApprovalController {

    @Resource
    private StockOutApprovalService stockOutApprovalService;

    @RequestMapping("list")
    public Result list(@RequestBody(required = false) Page<StockOutApproval> stockOutApproval){
        return stockOutApprovalService.getStockList(stockOutApproval);
    }

    @PutMapping("update")
    public Result update(@RequestBody(required = false) StockOutApproval stockOutApproval) {
        return stockOutApprovalService.updateStockIn(stockOutApproval);
    }

    @PutMapping("update2")
    public Result update2(@RequestBody(required = false) StockOutApproval stockOutApproval) {
        return stockOutApprovalService.updateStockIn2(stockOutApproval);
    }
}
